#pragma once
#include "IMenuState.h"
#include "../SGD Wrappers/SGD_Geometry.h"
#include <vector>

class EntityManager;
class Entity;
class CPlayer;
class CBall;
class CWall;
class CGorbi;
class CCannyble;
class CPowerUp;
class CAlly;
class CRunner;
class CTank;
class CStriker;
class CBomber;
class CPunch;

class CPracticeMode :
	public CIMenuState
{
	CPracticeMode() = default;
	~CPracticeMode() = default;

	CPracticeMode(const CPracticeMode&) = delete;
	CPracticeMode& operator= (const CPracticeMode&) = delete;

	// Entities
	EntityManager*	m_pEntities = nullptr;

	CPlayer*		m_pCurrPlayer = nullptr;

	CPlayer*		m_pPlayer1 = nullptr;
	CPlayer*		m_pPlayer2 = nullptr;
	CPlayer*		m_pPlayer3 = nullptr;
	CPlayer*		m_pPlayer4 = nullptr;
	CBall*			testBall;
	CWall*			testWall;
	CPowerUp*		testPowerUp;
	CGorbi*			testGorbi;
	CCannyble*		testCannyble;

	CWall*			m_TopWall;
	CWall*			m_BotWall;
	CWall*			m_LeftWall;
	CWall*			m_RightWall;

	CPunch*			m_pPunch;

	float			m_fPunchTimer;
	std::vector<Entity*> m_AllEnts;
	std::vector<CCannyble*> m_Cannys;

	int m_nEntitySpawnIndex = 0;

	// Bools to display tooltips for each object type
	bool m_bHighWalls;
	bool m_bLowWalls;
	bool m_bBalls;
	bool m_bRunner;
	bool m_bStriker;
	bool m_bBomber;
	bool m_bTank;
	bool m_bPowerups;
	bool m_bGorbi;
	bool m_bCannybles;

public:	
	static  CPracticeMode* GetInstance(void);

	virtual void Enter(void);
	virtual void Exit(void);

	virtual bool Input(void);
	virtual void Update(float elapsedTime);
	virtual void Render(void);

	// Factory Methods
	Entity* CreateBall(SGD::Point position, SGD::Size size);
	Entity* CreateWall(SGD::Point position, SGD::Size size, bool highLow);
	Entity* CreateCannyble(SGD::Point position, SGD::Size size);
	Entity* CreatePunch(Entity* pOwner);

	EntityManager* GetEManager()const { return m_pEntities; }

	void DeleteEntity(Entity* e);

	// Tutorial collision
	void HandleCollision();
};

